package cn.bugstack.mcp.server.niuke.domain.service;

import cn.bugstack.mcp.server.niuke.domain.adapter.INiuKePort;
import cn.bugstack.mcp.server.niuke.domain.model.ArticleFunctionRequest;
import cn.bugstack.mcp.server.niuke.domain.model.ArticleFunctionResponse;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

import java.io.IOException;

@Service
@Slf4j
public class NiuKeArticleService {

    @Resource
    private INiuKePort port;

    @Tool(description = "发送牛客文章")
    public ArticleFunctionResponse createArticle(ArticleFunctionRequest request) throws IOException {
        log.info("开始发送牛客文章：request:{}", request);
        return port.createArticle(request);
    }
}
